<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>动画</title>
    <style>
        .animate {
            width: 100px;
            height: 100px;
            background: #f40;
            animation: aa 2s linear infinite;
            -webkit-animation: aa 1000 linear infinite; 
            position: relative;
        }

        @keyframes aa {
            0%   {background: red; left:0px; top:0px;}
            25%  {background: yellow; left:200px; top:0px;}
            50%  {background: blue; left:200px; top:200px;}
            75%  {background: green; left:0px; top:200px;}
            100% {background: red; left:0px; top:0px;}
        }
    </style>
</head>
<body>
    
    <div class="animate">

    </div>

</body>
</html>